package 数组练习题;

import java.util.Scanner;

/*用一个数组存储本组学员的姓名，先从键盘输入小组人数，再从键盘输入每一个学员的姓名，然后遍历显*/
public class Demo3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入小组人数：");
        int count = scanner.nextInt();
        String[] name = new String[count];
        for (int i = 0; i < count; i++){
            System.out.print("请输入第"+(i+1)+"个同学的姓名：");
            name[i] = scanner.next();
        }
        for (int i = 0; i < count; i++){
            System.out.print(name[i]+" ");
        }
    }
}
